package com.cn

import java.text.SimpleDateFormat
import java.util.Locale

import scala.collection.mutable.ArrayBuffer
import scala.util.matching.Regex

object Test11 {


  def main(args: Array[String]): Unit = {
//    var ip = "1.28.244.0";
//
//    val str: Array[String] = ip.split("\\.")
//    var ipNum = 0L
//    for (i <- 0 until str.length){
//      ipNum =  str(i).toLong | ipNum << 8L
//      println(ipNum)
//    }
//
//    println(ipNum)

//    var str = "GET http://cdn.v.abc.com.cn/140650.mp4?ddsda HTTP/1.1"
//    val s: Array[String] = str.split(" ")
//    val url: String = s(1)
//    if (url.contains("?")){
//      println( url.substring(url.indexOf("cn/")+3,url.indexOf("?")))
//    }else{
//      println(url.substring(url.indexOf("cn/")+3))
//    }

//    val string = "15/Feb/2017:00:00:46"
//    val sf = new SimpleDateFormat("dd/MMM/yyyy:hh:mm:ss", Locale.ENGLISH)
//    println(sf.parse(string))

//    val pattern = new Regex("([\\w])[\\s]")
//    val str = "100.79.121.48 HIT 33 [15/Feb/2017:00:00:46 +0800] \"GET http://cdn.v.abc.com.cn/videojs/video.js HTTP/1.1\" 200 174055 \"http://www.abc.com.cn/\" \"Mozilla/4.0+(compatible;+MSIE+6.0;+Windows+NT+5.1;+Trident/4.0;)\""
//
//    val s: Array[String] = str.split(" ")
//
////    println((s(3) + s(4)).replaceAll("\\[|\\]",""))
//    s.foreach(println(_))

//    var str = "15/Feb/2017:00:00:46+0800"
//    val format = new SimpleDateFormat("dd/MMM/yyyy:HH:mm:ss", Locale.ENGLISH)
//    val fromat_1 = new SimpleDateFormat("yyyy-MM-dd HH")
//    println(fromat_1.format(format.parse(str)))

//    var array =  ArrayBuffer[(Int,Int)]()
//    array += Tuple2(1,1)
//
//
//   var text = "INFO 2019-09-01 00:29:53 requestURI:/click?app=1&p=1&adid=18005472&industry=469&adid=31"
//    val splits: Array[String] = text.split("&")
//    var arrayBuffer = ArrayBuffer[(String, Int)]()
//    for (elem <- splits) {
//      if (elem.contains("adid")) {
//        val strings: Array[String] = elem.split("=")
//        arrayBuffer += Tuple2(strings(1), 1)
//      }
//    }
//    for (elem <- arrayBuffer) {
//      println(elem)
//    }

    var aa = Array(1,2,3,4,5,6)
    println(aa.indexOf(aa.min))
  }
}
